Skip to content

refactor: move Slack types to their own file#5224

Open
santiagofn wants to merge 1 commit intoprometheus:mainfrom
santiagofn:refactor/slack-extract-types
Open

refactor: move Slack types to their own file#5224
santiagofn wants to merge 1 commit intoprometheus:mainfrom
santiagofn:refactor/slack-extract-types

Conversation

@santiagofn
Copy link
Copy Markdown

@santiagofn santiagofn commented May 6, 2026

This is the first in a series of PRs that together implement threaded message support for the Slack notifier. The full picture is available in #5150.

Summary

Extracts the Slack notifier's internal types (Notifier, request, attachment, slackResponse) from slack.go into a dedicated types.go file. No behavioral changes.

Signed-off-by: Santiago Fernández Núñez <santiago.nunez@nubank.com.br>
@santiagofn santiagofn requested a review from a team as a code owner May 6, 2026 17:51
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 6, 2026

📝 Walkthrough

Walkthrough

This PR adds configuration files to ignore JetBrains IDE and Slack plans directories, and refactors Slack notifier type definitions into a dedicated types file while preserving existing functionality.

Changes

Gitignore Configuration

Layer / File(s) Summary
IDE & Plan Exclusions
.cursor/.gitignore, .gitignore
Added ignore patterns for .cursor/plans/ and .idea/ directories to exclude Slack plan storage and JetBrains IDE project files.

Slack Notifier Type Refactoring

Layer / File(s) Summary
Type Definitions
notify/slack/types.go
New file introduces exported Notifier struct with configuration, template, logger, HTTP client, and retry fields; adds internal types for Slack API payloads (request, attachment) and responses (slackResponse).
Implementation Cleanup
notify/slack/slack.go
Code reorganization with no observable functional changes; type definitions extracted or moved out, existing Notifier initialization and Notify logic remain intact.

🎯 2 (Simple) | ⏱️ ~8 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main refactoring: extracting Slack types into a separate file, which is the primary change across the diff.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description check ✅ Passed The pull request description provides a clear, concise explanation of the changes, references the related issue, and explains the context within a larger refactoring effort.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@SoloJacobs
Copy link
Copy Markdown
Contributor

Looks pretty good, just some small nits.

@TheMeier TheMeier self-requested a review May 7, 2026 06:44
Comment thread notify/slack/types.go
@@ -0,0 +1,73 @@
// Copyright 2019 Prometheus Team
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use the header without date (example config/config.go)

Comment thread .gitignore
/amtool
/data/
/vendor
.idea
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is no specific tools in .gitignore at the moment, I think this is intentional. So I would says this should be remove (same for the new .cursor/.gitignore)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants